﻿using System;
using System.IO;
using ManagedCuda;

namespace RayDen.RayEngine.IntersectionEngines.Cuda
{
    public class NVContext : IDisposable
    {
        public CudaContext Context;

        public NVContext()
        {
            Context = new CudaContext(true);
            
        }

        public void Dispose()
        {
            if (Context != null)
            {
                Context.Dispose();
            }
        }

        public CudaKernel LoadKernel(Stream str, string kernelName)
        {
            return Context.LoadKernelPTX(str, kernelName);
        }
    }
}
